﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// ChiTietThanhPhanThucPham Repository. Good example of CRUD operations.
    ///// </summary>
    public class ChiTietThanhPhanThucPhamRepository : IChiTietThanhPhanThucPhamRepository
    {
        private static readonly IChiTietThanhPhanThucPhamDao _chiTietThanhPhanThucPham = DataAccess.ChiTietThanhPhanThucPhamDao;
        public List<ChiTietThanhPhanThucPham> GetList()
        {
            return _chiTietThanhPhanThucPham.GetChiTietThanhPhanThucPham().ToList();
        }

        public ChiTietThanhPhanThucPham Get(string id)
        {
            return _chiTietThanhPhanThucPham.GetChiTietThanhPhanThucPhamByID(id);
        }

        public void Insert(ChiTietThanhPhanThucPham t)
        {
            _chiTietThanhPhanThucPham.InsertChiTietThanhPhanThucPham(t);
        }

        public void Update(ChiTietThanhPhanThucPham t)
        {
            _chiTietThanhPhanThucPham.UpdateChiTietThanhPhanThucPham(t);
        }

        public void Delete(ChiTietThanhPhanThucPham t)
        {
            _chiTietThanhPhanThucPham.DeleteChiTietThanhPhanThucPham(t);
        }
    }
}